from scavenger import Scavenger
from time import sleep

sleep(2)

def subtract(x, y):
    print 'local execution'
    return x - y

print Scavenger.scavenge('daimi.test.subtract', {'x':1, 'y':3}, """
def perform(x, y):
    return x - y
""", subtract)

print Scavenger.scavenge('daimi.test.add', (1, 43), """
def perform(x, y):
    return x + y
""")
print Scavenger.scavenge('daimi.test.add', [1, 43])

Scavenger.shutdown()
